#include <func.h>

int main()
{
    int fds[2];//0读1写
    pipe(fds);
    if(fork())
    {
        close(fds[1]);
        char buf[10]={0};
        read(fds[0],buf,sizeof(buf));
        printf("%s\n",buf);
        return 0;
    }
    else
    {
        close(fds[0]);
        write(fds[1],"hello",5);
        return 0;
    }
}